package com.mapbased.wfw.components;

import java.io.*;
import java.util.*;

import org.dom4j.*;
import com.mapbased.wfw.*;
import com.mapbased.wfw.PageLoader.StringBufferBag;
import com.mapbased.wfw.PageLoader.LoadContext;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: mapbased.com</p>
 *
 * @author chy_hs(Baily)
 * @version 1.0
 */
public class Select
    extends Component
{
    Binding selectedValues;
    Binding listValues;

    public Select()
    {
        super();
    }

    /**
     *
     * @param ele Element
     * @param loader PageLoader
     * @return Element
     * @todo Implement this com.mapbased.wfw.Component method
     */
    public Element parseXml(Element ele,PageLoader.LoadContext lc)
    {
        LoadContext nlc=new LoadContext(lc);
        List segs=nlc.segments;
        StringBufferBag bag=nlc.last;

        bag.buffer.append('<').append(ele.getName());
        lc.loader.resolveUrl(ele,lc);
        lc.loader.parseAttributes(ele.attributes(),nlc);
        lc.loader.parseNameSpace(ele,segs,bag);
        bag.buffer.append(">");
        segs.add(bag.getString());
        this.segments=segs.toArray();
        return null;
    }

    /**
     * render
     *
     * @param context RenderContext
     * @throws IOException
     * @todo Implement this com.mapbased.wfw.Component method
     */
    public void render(RenderContext ctx)
        throws IOException
    {
        this.defalutRenderBehavior(ctx);

    }

    /**
     * renderHeader
     *
     * @param context RenderContext
     * @param sb StringBuffer
     * @param m Map
     * @todo Implement this com.mapbased.wfw.Component method
     */
    public void renderHeader(RenderContext context,StringBuffer sb,Map m)
    {
    }
}
